angular.module('driver',[
  'angular-meteor',
  'ui.router',
  'angularUtils.directives.dirPagination',
  'ionic',
  'ionic.contrib.frostedGlass',
  'ngCordova',
  'ngAnimate',
  'ngFileUpload',
  'angularFileUpload'
]);


/*
img 的 src 上有 unsafe前缀
http://jackie198512.blog.163.com/blog/static/960702420141125102341902/
tel 上有 unsafe前缀
http://stackoverflow.com/questions/15606751/angular-changes-urls-to-unsafe-in-extension-page
*/
angular.module("driver").config(['$compileProvider',
  function($compileProvider) {
    $compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|javascript|content|data):/);
    $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|chrome-extension):/);
  }
]);


function onReady() {
  angular.bootstrap(document, ['driver']);
}

if (Meteor.isCordova)
  angular.element(document).on("deviceready", onReady);
else
  angular.element(document).ready(onReady);

